package com.sx.gongzhong.activity;

import android.os.Bundle;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.sx.gongzhong.BaseActivity;
import com.sx.gongzhong.R;
import com.sx.gongzhong.adapter.LegalTypeSelectAdapter;
import com.sx.gongzhong.model.LegalAdviceTypeBean;
import com.sx.gongzhong.utils.AppConstants;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;

/**诉求申请类型选择
 * Created by admin on 2018/1/4.
 */

public class AppealTypeSelectActivity extends BaseActivity implements SwipeRefreshLayout.OnRefreshListener {
    @BindView(R.id.swipeRefreshLayout)
    SwipeRefreshLayout swipeRefreshLayout;
    @BindView(R.id.recyclerView)
    RecyclerView recyclerView;
    private List<LegalAdviceTypeBean> legalAdviceTypeBeans=new ArrayList<>();

    @Override
    public void setUI(Bundle savedInstanceState) {
        setContentView(R.layout.refresh_list);
        ButterKnife.bind(this);
        setTitleName("诉求类型");
        initView();
        onRefresh();
    }

    private void initView() {

        legalAdviceTypeBeans.add(new LegalAdviceTypeBean("民事相关"));
        legalAdviceTypeBeans.add(new LegalAdviceTypeBean("经济相关"));

        if (swipeRefreshLayout != null) {
            swipeRefreshLayout.setColorSchemeResources(AppConstants.colors);
            swipeRefreshLayout.setOnRefreshListener(this);
        }
        recyclerView.setLayoutManager(new LinearLayoutManager(this,LinearLayoutManager.VERTICAL,false));
        LegalTypeSelectAdapter selectAdapter =
                new LegalTypeSelectAdapter(this,R.layout.item_type_list,legalAdviceTypeBeans);
        selectAdapter.setEmptyView(View.inflate(this,R.layout.load_error_view,null));
        recyclerView.setAdapter(selectAdapter);
        selectAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
            @Override
            public void onItemClick(BaseQuickAdapter adapter, View view, int position) {

            }
        });
    }

    @Override
    public void onRefresh() {
    }
}
